angular.module('starter')

  .controller('FeedCtrl', function ($scope,$http, $timeout) {

    getPostsByClubId = IP_ADDRESS+"/st-core/post!getAll.action?post.clubId=1&callback=JSON_CALLBACK";
    
    $http.jsonp(getPostsByClubId).success(
      function (data) {

        $scope.Posts = data;

        console.log(data);

      }
    ).error(function () {

      console.log("获得社团所有帖子失败，url", getAllClubsUrl);
    });

    $scope.doRefresh = function () {
      $timeout(function () {
        $scope.$broadcast('scroll.refreshComplete');



        $http.jsonp(getPostsByClubId).success(
          function (data) {

            $scope.Posts = data;

            console.log(data);

          }
        ).error(function () {

          console.log("获得社团所有帖子失败，url", getAllClubsUrl);
        });

      }, 2000)
    };
  });
